package com.itzjc.dao;

import com.itzjc.domain.pojo.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * TODO
 *
 * @className: ProjectDao
 * @date: 2021-06-10 21:57
 **/
public interface ProjectMapper {
    List<ProjectInfo> findById(Integer userId);

    void createProjectById(@Param("uid") Integer requestProject, @Param("pjId") Integer id);

    void createProject(ProjectInfo projectInfo);

    void deleteProjectByToken(Integer projectId);

    void deleteProjectUzserByToken(@Param("uid") Integer userId, @Param("pjId") Integer projectId);

    List<ProjectInfo> findByIdAndOpeningStatus(Integer userId);

    List<ProjectInfo> findByIdAndOpenedStatus(Integer userId);

    List<ProjectInfo> findByIdAndauthorizing(Integer userId);

    List<ProjectInfo> findByIdAndauthorized(Integer userId);


    ProjectInfo beforeCreateProject(@Param("uid")Integer uid, @Param("projectName") String projectName);


    Integer exitProject(@Param("uid")Integer userId, @Param("pjId")Integer projectId);

    CurrentProjectInfo getProjectById(Integer projectId);

    String getType(Integer type);

    String getProjectImg(Integer projectId);


    Double getMaxWindValue(Integer projectId);

    Double getMaxTemperatureValue(Integer projectId);

    Double getMaxDeflectionValue(Integer projectId);

    Double getMaxStressValue(Integer projectId);

    LifeEstimationInfo getLifeEstimationInfo(Integer projectId);

    Double getMaxDispalcementValue(Integer projectId);

    void updateProjectImg(@Param("img")String img,@Param("pjId") Integer projectId);

    void updateWholeProject(ProjectInfo projectInfo);

    String getProjectObj(Integer projectId);

    String getProjectMtl(Integer projectId);

    void updateProjectModule(@Param("obj")String obj, @Param("mtl")String mtl,@Param("pjId") Integer projectId);

    void createProjectImg(@Param("img") String img,@Param("pjId") Integer pjId);

    void createProjectModule(@Param("obj") String obj, @Param("mtl") String mtl, @Param("pjId") Integer pjId);


    void createProjectFile(ProjectFileInfo projectFileInfo);

    void createProjectVSFile(@Param("fileId")Integer fileId,@Param("pjId") Integer pjId);

    Integer findStatusById(Integer userId);

    List<ProjectInfo> findAll();

    FileInfo getMethodURLAndAgreementURLById(Integer projectId);

    void updateProjectFileStatus(Integer pjId);

    List<ProjectInfo> findAllAuditingProject();

    List<ProjectInfo> findAllAuditedProject();

    List<FileInfo> findAllFiles();

    List<User> findAllUserInfo();

    List<RelationUserAndProject> findAllRelationUserAndProject();

    String getCdn();

    void okForThisProject(Integer projectId);

    void rejectCurrentProject(@Param("projectId")Integer projectId, @Param("reason")String reason);

    void sureCurrentProjectStage(@Param("projectId")Integer projectId,@Param("stage") Integer stage);

    User getUserInfoById(Integer projectId);

    List<User> getBlockedUsers();

    List<User> getUnBlockedUsers();

    void recoverUser(Integer uIdForUser);

    void moveOutUser(Integer uIdForUser);

    List<User> searchAllUserInfo(String word);

    List<ProjectInfo> searchAllInTableUsers(String word);

    List<ProjectInfo> searchAllInTableProjectInfo(String word);

    List<ProjectInfo> searchAllInTableProjectInfoById(@Param("userId")Integer userId, @Param("word")String word);

    List<FileFromCenter> findAllFileFromCenter();

    void uploadFileToCenter(FileFromCenter fileFromCenter);

    void deleteFileFromCenterByToken(Integer fileId);

    void generateForgetCode(String info);

    void deleteUser(Integer uIdForUser);
}
